package com.test3;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Admin on 9/17 0017.
 */
public class InstanceFactory {
    private Map<String,Car> car=new HashMap<String, Car>();
    private InstanceFactory(){
        car=new HashMap<String, Car>();
        car.put("audi",new Car("audi",300000));
        car.put("bm",new Car("bm",400000));
    }
    public Car getCar(String name){
        return car.get(name);
    }
}
